package com.nc.delivery_project.client.schedule_details;

import com.google.gwt.core.client.GWT;
import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.google.gwt.place.shared.Prefix;
import com.google.web.bindery.requestfactory.shared.RequestFactory;

/**
 * Created by DRAGON on 14.01.2015.
 */
public class ScheduleDetailsPlace extends Place {
    @Prefix("schedule_details")
    public static class Tokenizer implements PlaceTokenizer<ScheduleDetailsPlace> {

        private RequestFactory requestFactory;

        public Tokenizer(RequestFactory requestFactory) {
            this.requestFactory = requestFactory;
        }

        @Override
        public String getToken(ScheduleDetailsPlace place) {
            return place.getToken();
        }

        @Override
        public ScheduleDetailsPlace getPlace(String token) {
            GWT.log(token);
            return new ScheduleDetailsPlace(token);
        }

    }

    private String token;

    public ScheduleDetailsPlace(String token) {
        this.token = token;
    }

    public String getToken() {
        return token;
    }
}
